home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #11 / Amiga Plus CD - 2004 - No. 11.iso / AmiSoft / Misc / emu / ASpEmu_NOROM.lha / ASpV084 / Rexx / SaveSCR.asprx < prev   
Text File  |  2000-10-20  |  1KB  |  41 lines

  1. /* $VER: SaveSCR 1.1 */
  2.  
  3. /* Save the current display to a SCR file. */
  4.  
  5.  
  6. OPTIONS RESULTS
  7.  
  8. GETVERSION            /* ask which ASp version is running */
  9. IF result<760 THEN DO        /* minimum of V0.76 to use this script */
  10.     ADDRESS COMMAND 'requestchoice >nil: TITLE "ASp ARexx Error" BODY "Requires ASp V0.76 or newer!" GADGETS "OK"'
  11.     EXIT
  12. END
  13.  
  14.  
  15. /* A messy File Requester using the DOS C:RequestFile command.. */
  16.  
  17. ADDRESS COMMAND "RequestFile >T:ASpRequest PATTERN=#?.SCR SAVEMODE POSITIVE=Save"
  18. OPEN(TMPFILE,'T:ASpRequest',R)
  19. filename=STRIP(READLN(TMPFILE),B,'"')
  20. CLOSE(TMPFILE)
  21.  
  22.  
  23. IF OPEN(SCRFILE,filename,WRITE) THEN DO        /* open the file */
  24.     GETPAGE                    /* which screen? */
  25.     p=RESULT
  26.     IF BITTST(D2C(p),3) THEN DO        /* bit 3= scr buf */
  27.         SETPAGE 7            /* force shadow page in */
  28.         READRAM 49152 6912        /* read pic data */
  29.         filedata=result
  30.         SETPAGE p            /* put paging back */
  31.     END
  32.     ELSE DO
  33.         READRAM 16384 6912        /* read pic from normal display */
  34.         filedata=result
  35.     END
  36.     WRITECH(SCRFILE,filedata)        /* write it */
  37.     CLOSE(SCRFILE)                /* tidy up behind us.. */
  38. END
  39.  
  40.  
  41.